package cn.acmoj.oj.bean;

public class Ranklist {

    private int solved;
    private long time;
    private int[] p_wa_num;
    private long[] p_ac_sec;
    private String user_id;
    private String nick;

    public Ranklist(int num) {
        this.p_wa_num = new int[num];
        this.p_ac_sec = new long[num];
    }

    public int getSolved() {
        return solved;
    }

    public void setSolved(int solved) {
        this.solved = solved;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public int[] getP_wa_num() {
        return p_wa_num;
    }

    public void setP_wa_num(int[] p_wa_num) {
        this.p_wa_num = p_wa_num;
    }

    public long[] getP_ac_sec() {
        return p_ac_sec;
    }

    public void setP_ac_sec(long[] p_ac_sec) {
        this.p_ac_sec = p_ac_sec;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public void add(int pid, long sec, int res) {
        if (this.p_ac_sec[pid] > 0) {
            return;
        }
        if (res != 4) {
            this.p_wa_num[pid]++;
        } else {
            this.p_ac_sec[pid] = sec;
            this.solved++;
            this.time += sec + this.p_wa_num[pid] * 1200000;
        }
    }
}
